package com.back.service.impl;

import com.back.domain.VO.SYSTEM.SysUserPagingBody;
import com.back.domain.VO.SysUserVO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.back.domain.SysUser;
import com.back.service.SysUserService;
import com.back.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author 陈胜杰
* @description 针对表【sys_user(用户表)】的数据库操作Service实现
* @createDate 2024-07-12 09:56:27
*/
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser>
    implements SysUserService{
    @Autowired
    public SysUserMapper sysUserMapper;
    public Map<String, Object> sysUserGetAll(SysUserPagingBody sysUserPagingBody){
        Integer count = sysUserMapper.sysUserGetCount();
        List<SysUserVO> sysUserVOS = sysUserMapper.sysUserGetAll(sysUserPagingBody);
        Map<String, Object> response = new HashMap<>();
        response.put("total", count);
        response.put("page", sysUserPagingBody.getOffset());
        response.put("limit", sysUserPagingBody.getLimit());
        response.put("data", sysUserVOS);
        return response;
    }
}




